function [result] = read8(input,dim1,dim2,dim3,dim4,dim5,dim6,dim7,dim8)

    result(dim1,dim2,dim3,dim4,dim5,dim6,dim7,dim8)=0.0;
    a=dim8*dim7*dim6*dim5*dim4*dim3*dim2;
    b=dim8*dim7*dim6*dim5*dim4*dim3;
    c=dim8*dim7*dim6*dim5*dim4;
    d=dim8*dim7*dim6*dim5;
    e=dim8*dim7*dim6;
    f=dim8*dim7;
    g=dim8;
    for h=1:dim1
        for i=1:dim2
            for j=1:dim3
                for k=1:dim4
                    for m=1:dim5
                        for n=1:dim6
                            for o=1:dim7
                                for p=1:dim8
                                    result(h,i,j,k,m,n,o,p)=input(a*(h-1)+b*(i-1)+c*(j-1)+d*(k-1)+e*(m-1)+f*(n-1)+g*(o-1)+p);
                                end
                            end
                        end
                    end
                end
            end
        end
    end

end